<?php
include_once("$config[webroot]/module/album/includes/plugin_album_class.php");
include_once("includes/page_utf_class.php");
$album=new album();
$catid=$_GET['id'];
$sql="select a.*,b.custom_cat_id from ".ALBUM." a left join ".CUSTOM_CAT_REL." b on a.id=b.relating_id  where 
			 b.custom_cat_id='$catid'";

$db->query($sql);
$album=$db->getRows();

for($i=0;$i<count($album);$i++)
		{
			$sql="select a.name,b.custom_cat_id from ".CUSTOM_CAT." a, ".CUSTOM_CAT_REL." b where a.id=b.custom_cat_id and 
			b.custom_cat_type=6 and b.relating_id=".$album[$i]['id'];
			$db->query($sql);
			$custom_list=$db->fetchRow();
			$album[$i]["album_custom_name"] = $custom_list['name'];
			$album[$i]["custom_cat_id"] = $custom_list['custom_cat_id'];
		}


$tpl->assign("de",$album);
$tpl->assign("title",$album[0][album_custom_name]);
include_once("footer.php");
$tpl->display("album_view.htm");
?>
